//
//  Calculator.swift
//  CommandPattern
//
//  Created by LY on 2017/11/7.
//  Copyright © 2017年 DesignPatterns. All rights reserved.
//

import Foundation
class Calculator {
    private(set) var total = 0
    func add(amount:Int){
        total += amount
    }
    func subtract(amount:Int){
        total -= amount
    }
    func multiply(amount:Int){
        total *= amount
    }
    func divide(amount:Int){
        total /= amount
    }
}
